<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	template="/WEB-INF/templates/default.xhtml"
	xmlns:pe="http://primefaces.org/ui"
>

	<f:metadata>
		<f:viewParam name="bulletinId" value="#{bulletinHome3.id}" ></f:viewParam>
		<f:viewParam name="tradeId" value="#{tradeHome.id}"></f:viewParam>
		<f:viewParam name="taskId" value="#{bpmHome.taskId}"></f:viewParam>
	   	<f:event listener="#{tradeHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="取消报名审核"></f:viewParam>
	</f:metadata>
	<ui:define name="head">
		<style type="text/css">
			.removeButton {
				float: right;
				margin-right: 20px;
			}
			
			.limitUnit {
				margin-top: 5px;
			}
			h2{
   				text-align:center
   			}
   			.rowStyle{
	   			text-align: center;
	   			font-size:16px
   			}
		</style>
	</ui:define>
	<ui:define name="content">

		<h:form id="editForm">
			<p:panel
				id="panel"
				header="公告基本信息"
				style="margin-bottom:10px;"
			>
				<p:messages id="messages" closable="true">
		       		<p:autoUpdate />
		       	</p:messages>
				<ui:include src="/manage/template/include/bulletinInfo.xhtml" />
			</p:panel>
			
			<ui:include src="/manage/template/include/bulletinReqInfo.xhtml" />
			<p:panel
				id="photos"
				header="交易申请表"
				style="margin-bottom:10px;"
						>
					<div id="imgsPreview" >
						<p:repeat
							var="_photo"
							value="#{bulletinHome3.instance.photos}"
						>
							<img  data-original="#{attachmentUtils.getFullPath(_photo)}" src="#{attachmentUtils.getFullPath(_photo)}"  width="240"/>
						</p:repeat>
					</div>	
				</p:panel>
			<p:panel header="相关附件">	
				 <ui:include src="/WEB-INF/templates/include/bulletinAttachments.xhtml" />
			</p:panel>
			<p:panel header="公告要求材料">
				<p:repeat var="_req" value="#{tradeHome.instance.requirements}">
					<h3 style="padding:5px;">#{_req.requirementDefination.requiredName}</h3>
					<p:repeat  var="_attr" value="#{_req.attachments}" varStatus="_status">
						<li style="border:none;padding:5px;text-indent:2em;">
							<p:commandLink value="#{_status.index + 1}、#{_attr.filename}" ajax="false" immediate="true">
						        <p:fileDownload value="#{attachments.attr}">
						        	<f:param name="id" value="#{_attr.id}"></f:param>
						        </p:fileDownload>
						        <f:param name="id" value="#{_attr.id}"></f:param>
						    </p:commandLink>
						</li>
					</p:repeat>
				</p:repeat>
			</p:panel>
			当前中介：<span style="display:inline-block;font-size:18px;font-weight:bold;margin:10px;color:red;">#{tradeHome.instance.supplier.cnname}</span>
			<br/>	
			<p:outputLabel value="取消原因：" ></p:outputLabel>
			<h:outputText value="#{tradeHome.instance.cancelReason}" style="display:inline-block;font-size:18px;font-weight:bold;margin:10px;color:red;"/>
			<br/>	
			<p:outputLabel value="审批意见" for="approvalDesc" style="display:inline-block; margin-bottom: 60px;    vertical-align: middle;"></p:outputLabel>
   			<p:inputTextarea id="approvalDesc"
   				required="true"
   				value="#{tradeHome.instance.adminRejectReason}"
   				rows="5"
   				cols="80"></p:inputTextarea>
   			<br/>		
		
			
			<p:commandButton
				action="#{tradeHome.adminAudit()}"
				value="审核通过"
				ajax="false"
			/>			
			<p:commandButton
				action="#{tradeHome.adminReject()}"
				value="驳回"
				ajax="false"
			/>		
			<ui:remove>
				<p:commandButton
					action="#{bpmHome.deleteTask()}"
					value="结束此流程"
					ajax="false"
					immediate="true"
					
					rendered="#{tradeHome.instance.bulletin.tradeStatus eq 'Agreed' or tradeHome.instance.bulletin.tradeStatus eq 'Waiting'}"
				/>		
			</ui:remove>
			<p:button outcome="CancelApplyTaskList.xhtml" value="取消"></p:button>
		</h:form>
	</ui:define>
</ui:composition>
